
const searchFormList = [
  { label: '关键词', value: 'query', type: 'input', width: '180px' },
  { label: '用户ID', value: 'userid', type: 'input', width: '200px' },
  { label: '明星ID', value: 'starid', type: 'input', width: '180px' },
  { label: '记录时间', value: 'stime', type: 'date', width: '320px', dateType: 'daterange' },
  { label: '', width: '320px', value: 'btn', type: 'slot' }
];

const tables = [ // 表格数据
  { label: '记录ID', value: 'id', width: 140 },
  { label: '行程名称', value: 'title' },
  { label: '行程时间', width: 130, type: 'slot', value: 'duetime' },
  { label: '用户名称', value: 'user', minwidth: 160 },
  { label: '状态', type: 'slot', sort: 'custom', value: 'status', width: 120 },
  { label: '明星名称', type: 'slot', value: 'starid', width: 120 },
  { label: '城市', value: 'city', width: 120 },
  { label: '提交时间', width: 140, type: 'slot', value: 'stime' },
  { label: '操作', type: 'slot', value: 'btn', width: 220 }
];

const fieldList = [ // 新增弹出数据
  { label: '父级组织', value: 'pid', type: 'select', option: 'sysOrg',  loading: true, remote:true, store:"dictSrv/sysOrg", width: '300px'},
  { label: '组织名称', value: 'name', type: 'input', width: '300px' },
  { label: '组织编码', value: 'code', type: 'input', width: '300px' },
  { label: '创立时间', value: 'stime', type: 'date', width: '300px' },
  { label: '部门负责人', value: 'chargeuid', type: 'select', option: 'sysUser', loading: true, remote:true, store:"dictSrv/sysUser", width: '300px'},
  { label: '分管副总', value: 'prechargeuid', type: 'select', option: 'sysUser', loading: true, remote:true, store:"dictSrv/sysUser", width: '300px'},
  { label: '组织描述', value: 'desc', type:'textarea', width: '600px' }
]
const fieldData = (data)=>{
  var dataset = {};
  for (var idx = 0; idx < fieldList.length; idx++) {
    var ckey  = fieldList[idx].value;
    dataset[ckey] = (data && data[ckey])? data[ckey]:'';
  }
  dataset.id = (data && data.id)? data.id:0;
  return dataset;
}

export default {
  searchFormList, tables,fieldList,fieldData
};
